home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <math.h>
- #include <winb.h>
- #include <te.h>
- #include <fntb.h>
- #include <gui.h>
- #include <mos.h>
-
- int windowId = -1 ;
- int xMessageId = -1 ;
- int yMessageId = -1 ;
- int xPointMessageId = -1 ;
- int yPointMessageId = -1 ;
-
- /* initDataMWINDOW:NULL:MJ_ICONL40の呼び出し関数 */
- int exitFunc()
- {
- /* GM_QUITで参照するexitFunc関数の復帰値 */
- extern int exitFuncRet ;
-
- /* イベントループを終了させ、GUIを終了させる */
- /* 実際にはmain関数内のMMI_ExecSystem関数から抜ける */
- MMI_SetHaltFlag(TRUE) ;
- exitFuncRet = NOERR ;
-
- return NOERR ;
- }
-
- /* 座標を取得する関数 */
- void setPointFunc()
- {
- static int x ;
- static int y ;
-
- int x1 ;
- int y1 ;
- int button ;
-
- static char x2[6];
- static char y2[6];
-
- MOS_rdpos( &button, &x1, &y1 ) ;
-
- if ( x1 != x )
- {
- intToChrFunc( x1, 4, x2, 10 ) ;
- x = x1 ;
- MMI_SendMessage( xMessageId, MM_SETMSG, 1, x2 ) ;
- MMI_SendMessage( xMessageId, MM_SHOW, 0 ) ;
- }
-
- if ( y1 != y )
- {
- intToChrFunc( y1, 4, y2, 10 ) ;
- y = y1 ;
- MMI_SendMessage( yMessageId, MM_SETMSG, 1, y2 ) ;
- MMI_SendMessage( yMessageId, MM_SHOW, 0 ) ;
- }
-
- return ;
- }
-
- /* 変数を文字列にする関数 */
- int intToChrFunc( INnumber, place, RETnumber, notation )
-
- int INnumber ; /* 入力値 */
- int place ; /* n桁 */
- char RETnumber[] ; /* 戻り値 */
- int notation ; /* n進数 */
- {
- char ITnumber[17] = "0123456789ABCDEF" ;
- int x ; /* 一時的に保存する変数 */
- int z ; /* n進数に直す時の char ITnumber の位置を示す変数 */
- int i ; /* forループ用 */
-
- if( notation > 16 ) return ( -1 ) ;
-
- for ( i=place-1; i>=0; --i )
- {
- x = pow( notation, i );
- z = INnumber / x ;
- RETnumber[ place-1 - i ] = ITnumber[z] ;
- INnumber -= ( z * x ) ;
- }
-
- RETnumber[ place ] = 0x00 ;
-
- return NOERR ;
- }
-
- /* end of file */